package com.tanhua.server.controller;

import com.tanhua.domain.db.HuanxinUser;
import com.tanhua.server.interceptor.UserHolder;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/huanxin")
public class HuanxinController {
    /**
     *  环信-加载环信信息（账号和密码）
     * GET /huanxin/user
     */
    @GetMapping("/user")
    public ResponseEntity findHuanxinUser() {
        HuanxinUser user = new HuanxinUser();
        user.setUsername(UserHolder.getUserId().toString());
        user.setPassword("123456");
        return ResponseEntity.ok(user);
    }
}
